Ext.define('lph.browser.content.generic.DetailsPane', {
	/* Begin Definitions */
    extend	: 'Ext.Panel',
    
    region	: 'north',
    split	: true,
    height	: 300,
    layout	: 'border',
    frame   : false,
    border	: false,
    
    constructor: function(config){
    	this.callParent(arguments);
        this.initConfig(config);

        this.path = Ext.create('lph.browser.content.generic.PathPanel', {
			node		 : config.node,
			elem		 : config.elem
        });
        this.add(this.path);
   
        this.summaryPane = Ext.create('lph.browser.content.generic.SummaryPane');
        this.add(this.summaryPane);
        
        this.addListener('afterrender', this.onRendered, this);
        
        return this;
    },
    
    addTab: function(tab){
    	this.summaryPane.addTab(tab);
    },
    
    setActiveTab: function(tab){
    	this.summaryPane.setActiveTab(tab);
    },
    
    onRendered: function(){
        if(!Ext.isEmpty(this.model)){

            var errorFn = this.summaryPane.showErrorMessage;
            if(this.model=="Isomer" && !this.identified){
                errorFn = function(){};
            }

            this.summaryPane.showMask();
            Ext.ModelMgr.getModel(this.model).load(this.itemId, {
                scope	: this.summaryPane,
                success	: this.summaryPane.loadData,
                failure	: errorFn,
                callback: this.summaryPane.hideMask
            });
        }
    }
});